package U6;

import java.util.Scanner;

public class Test2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			boolean []vis  = new boolean[n + 100];
			for(int i = 0;i < m;i ++) {
				int s = sc.nextInt();
				int e = sc.nextInt();
				vis[s] = true;
				vis[e] = true;
			}
			int aim = 0;
			for(int i = 1;i <= n;i ++) {
				if(vis[i] == false) {
					aim = i;
					break;
				}
			}
			System.out.println(n - 1);
			for(int i = 1;i <= n;i ++) {
				if(aim != i) {
					System.out.println(aim + " " + i);
				}
			}
		}
	}

}
